package com.ruoyi.entity;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 调度模板
 * @TableName schedule_template
 */
@Data
public class ScheduleTemplateEntity implements Serializable {
    /**
     * 任务id
     */
    private Long id;

    /**
     * 模板类型 0：固定周期调度 1：自定义周期
     */
    private Integer type;

    /**
     * 调度周期：day:每天执行，week：每周执行，month：每月执行
     */
    private String cycleType;

    /**
     * 调度周期，默认一小时一次,固定周期
     */
    private String cycleTime;

    /**
     * 自定义调度周期：结构：1,2,5,6这种点分隔的结构，表示从开始时间1分钟后分别指定分钟后进行提醒
     */
    private String customCycleTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ScheduleTemplateEntity other = (ScheduleTemplateEntity) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
            && (this.getCycleType() == null ? other.getCycleType() == null : this.getCycleType().equals(other.getCycleType()))
            && (this.getCycleTime() == null ? other.getCycleTime() == null : this.getCycleTime().equals(other.getCycleTime()))
            && (this.getCustomCycleTime() == null ? other.getCustomCycleTime() == null : this.getCustomCycleTime().equals(other.getCustomCycleTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        result = prime * result + ((getCycleType() == null) ? 0 : getCycleType().hashCode());
        result = prime * result + ((getCycleTime() == null) ? 0 : getCycleTime().hashCode());
        result = prime * result + ((getCustomCycleTime() == null) ? 0 : getCustomCycleTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", type=").append(type);
        sb.append(", cycleType=").append(cycleType);
        sb.append(", cycleTime=").append(cycleTime);
        sb.append(", customCycleTime=").append(customCycleTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}